<?php $url = FEATHER_THEME_URL.'modules/bandit-social/'; ?>
	
<div id="nav-menus-frame">

	<!-- ######  Sidebar ###### -->
	
	<div id="menu-settings-column" class="metabox-holder">
		<form id="nav-menu-meta" action="options.php" class="nav-menu-meta" method="post">
			<?php settings_fields('bandit-social-settings'); ?>

			<div id="side-sortables" class="meta-box-sortables">
				
				<div class="postbox">
					<div class="handlediv" title="Click to toggle"><br></div>
					<h3 class="hndle"><?php _e( 'Create New Item', 'shaken' ); ?></h3>
					
					<div class="inside">
						<div class="bandit-sb-form">
							<p id="menu-item-url-wrap">
								<label class="howto" for="social-item-url">
									<span>URL</span>
									<input id="social-item-url" name="bandit_social[url]" type="text" class="code menu-item-textbox" value="http://">
								</label>
							</p>
							<p id="menu-item-name-wrap">
								<label class="howto" for="social-item-name">
									<span>Label</span>
									<input id="social-item-name" name="bandit_social[name]" type="text" class="regular-text menu-item-textbox">
								</label>
							</p>
							<p id="menu-item-name-wrap">
								<label class="howto" for="custom-menu-item">
									<span>Icon URL</span>
									<input id="social-item-icon" name="bandit_social[icon]" type="text" class="regular-text menu-item-textbox">
								</label>
							</p>
							<p class="button-controls">
								<span class="add-to-menu">
									<img class="waiting" src="<?php echo admin_url('images/wpspin_light.gif'); ?>" alt="">
									<input type="hidden" name="bandit_social[action]" value="new" />
									<input type="submit" id="bandit_social_submit" class="button-secondary submit-add-to-menu" value="Add Item">
								</span>
							</p>
						</div>
					</div><!-- #inside -->
				</div><!-- #postbox -->	
				
				<div class="postbox">
					<div class="handlediv" title="Click to toggle"><br></div>
					<h3 class="hndle">Icons</h3>
					
					<div id="bandit-icon-tabs" class="inside">
						<ul class="add-menu-item-tabs">
							<li><a class="nav-tab-link" href="#default-icons">Default</a></li>
						</ul>

						<div id="default-icons">
							<?php echo BanditSocial::default_icon_list(); ?>
							<p class="bandit-credit">Social Network Icon Pack by <a href="http://www.komodomedia.com" target="_blank">Komodo Media</a></p>
						</div>
					</div><!-- end .inside -->
				</div><!-- end .postbox -->	
						
			</div><!-- end #side-sortables -->
		</form><!-- end form -->
	</div><!-- end .metabox-holder -->
	
	<div id="bandit-social-content" class="postbox">
<?php if(BanditSocial::get_items()): ?>
<?php $items = BanditSocial::get_items(); ?>
		<div>
			<form id="nav-menu-meta" action="options.php" class="nav-menu-meta" method="post">
			<?php settings_fields('bandit-social-settings'); ?>
			<table class="bandit-social-table" cellpadding="0" cellspacing="0">
				<thead>
					<tr>
						<th class="icon">Icon</th>
						<th class="link">Link</th>
						<th class="title">Title</th>
						<th class="actions"></th>
					</tr>
				</thead>
				<tbody class="sortable">
					<?php foreach($items as $key=>$item): ?>
					<tr>
						<td class="icon">
							<img src="<?php echo $item['icon']; ?>" />
							<input name="bandit_social[<?php echo $key; ?>][icon]" type="text" class="code" value="<?php echo $item['icon_input']; ?>">
						</td>
						<td class="link">
							<input name="bandit_social[<?php echo $key; ?>][url]" type="text" class="code" value="<?php echo $item['url']; ?>">
						</td>
						<td class="title">
							<input name="bandit_social[<?php echo $key; ?>][name]" type="text" class="code" value="<?php echo $item['name']; ?>">
						</td>
						<td class="actions">
							<a href="#" class="bandit-link-move"><img src="<?php echo $url; ?>/img/move.png" alt="Move" title="Drag to Move" /></a>
							<a href="#" class="bandit-link-delete"><img src="<?php echo $url; ?>/img/delete.png" alt="Delete" /></a>
						</td>
					</tr>
					<?php endforeach; ?>
				</tbody>
				<tfoot>
					<tr>
						<td colspan="2">
							<input type="hidden" name="bandit_social[action]" value="update" />
							<input type="submit" id="bandit-social-update" class="button-primary" value="Update" />
						</td>
						<td colspan="2">
							<p class="bandit-credit">Module inspired by <a href="http://shakenandstirredweb.com/plugins/social-bartender/" target="_blank">Sawyer Hollenshead</a></p>
						</td>
					</tr>
				</tfoot>
			</table>
			</form>
		</div>
<?php else: ?>
		<div class="empty-message">
			<p><?php _e('You have not created any items.','creatic'); ?></p>
		</div>
<?php endif; ?>
	</div>
	
</div><!-- #nav-menus-frame -->
